<?php


namespace app\app\model;
use think\Model;

class Order extends Model
{
    public function getCreateTimeAttr($value)
    {
        return date('Y-m-d H:i:s',$value);
    }

    //kf_status_time
    public function getKfStatusTimeAttr($value)
    {
        if ($value){
            return date('Y-m-d H:i:s',$value);
        }else{
            return '';
        }
    }

    //cw_status_time
    public function getCwStatusTimeAttr($value)
    {
        if ($value){
            return date('Y-m-d H:i:s',$value);
        }else{
            return '';
        }
    }
    //获取状态
    public function getStatusAttr($value)
    {
        $status=[
            0=>array(
                'value'=>$value,
                'text'=>'待审核',
                'color_text'=>'rgba(245, 137, 21, 1)',
                'color_bg'=>'rgba(245, 137, 21, 0.10)',
            ),
            1=>array(
                'value'=>$value,
                'text'=>'已审核',
                'color_text'=>'rgba(33, 190, 144, 1)',
                'color_bg'=>'rgba(33, 190, 144, 0.10)',
            ),
            2=>array(
                'value'=>$value,
                'text'=>'审核未通过',
                'color_text'=>'rgba(224, 41, 49, 1)',
                'color_bg'=>'rgba(224, 41, 49, 0.10)',
            ),
        ];
        //status 审核状态 0待审核 1已审核 2审核失败
        return $status[$value];
    }
}